﻿using System.ComponentModel.Composition;
using XrmToolBox.Extensibility;
using XrmToolBox.Extensibility.Interfaces;

namespace NJL.OdataGenerator
{
    /// <summary>
    /// This class describe how to expose a plugin for XrmToolBox
    /// </summary>
    /// <remarks>
    /// </remarks>
    [Export(typeof(IXrmToolBoxPlugin)),
      ExportMetadata("Name", "Odata Generator Plugin"),
      ExportMetadata("Description", "Allows MS Dynamics CRM developers to generate quickly ODATA Queries"),
      ExportMetadata("SmallImageBase64", "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAgACADASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAACAcFAv/EACwQAAEEAQIFAwMFAQAAAAAAAAECAwQFEQAGBxUhQWESE4JCUXEUIiQxUoH/xAAWAQEBAQAAAAAAAAAAAAAAAAAABQH/xAAaEQACAwEBAAAAAAAAAAAAAAABAgADERIE/9oADAMBAAIRAxEAPwA1VVdNvrVEaKhx+U+vAA6lROqpG4Y11ayObyZ0uX3armPWhHguHofjnWHsZzke0LW4Y/bPfcRAZc7thQKnCPOAB8jpFUO9FbB4Y09jfLXOdmN/xo6cANtjzjU6+1y3IOASV6LnZ+VOASIyeGNdZNHk8udEl/Q1Zse2hfgODoD+calltXTqC2XGlNuR5TDmCD0KSNL3dm71774U2lpQLciGKkCVGICgtB+xxo+77c59s2nun+s9hxcCQ53cCAC2T5wSPiNKLnDYTojzXOr8sdE42I3zzadrTMdZzDiJ7DfdwIBDgHnBB+J0i6DZit+cMKeu3EhcNyK3mNJSQfW2f6yM6HdXPm0domTFU4xLYXkEdCgjVPjcTK6yZHO4UuPK7v1z/thfkoIIz+MaX0uG6A0TPTRYr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QmIy0hBCZadTd2dMSCIuh7HKZ2jtZE/8ATNUoiwXUBPSr+YF6Es8iE0mKt0ETycdu/vBjmLyk5T9+kHDn+4pUwhwxMBjGTcEMSud7h+dTeHFWo8HhgdVC9CaVQKNCehBDEWlp/9k="),
      ExportMetadata("BackgroundColor", "Black"),
      ExportMetadata("PrimaryFontColor", "Green"),
      ExportMetadata("SecondaryFontColor", "Green")]
    public class Plugin : PluginBase
    {
        /// <summary>
        /// This method return the actual usercontrol that will
        /// be used in XrmToolBox
        /// </summary>
        /// <returns>OdataGenerator control to display</returns>
        public override IXrmToolBoxPluginControl GetControl()
        {
            return new OdataGenerator();
        }
    }
}